﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace GUI
{
    public partial class QuanLiPhieuDatCho : Form
    {
        public QuanLiPhieuDatCho()
        {
            InitializeComponent();
        }

        private void btThem_Click(object sender, EventArgs e)
        {
            KHACHHANG_DTO kh = new KHACHHANG_DTO();
            PHIEUDC_DTO pdc = new PHIEUDC_DTO();
            kh.HoTen = tbHoTenKH.Text;
            kh.DienThoai = tbSoDT.Text;
            bool result1 = KHACHHANG_BUS.ThemKhachHang(kh);
          
            pdc.MaChuyenDL = cbChuyenDuLich.SelectedIndex;
            pdc.SoLuongKhach = int.Parse(tbSoLuongKhach.Text);
            pdc.MaKH = KHACHHANG_BUS.GetMaKHByDienThoai(tbSoDT.Text);
            bool result2 = PHIEUDATCHO_BUS.ThemPhieuDatCho(pdc);

            MessageBox.Show("Successful!", "Insert", MessageBoxButtons.OK, MessageBoxIcon.Information);

          
            /*
             *   bool result = KHACHSAN_BUS.ThemKhachSan(ks);
             MessageBox.Show("Successful!", "Insert", MessageBoxButtons.OK, MessageBoxIcon.Information);
            textBox1.Text = ks.MaKS.ToString();
            // this.textBox1.Text = this.dgvKhachSan.CurrentRow.Cells["MaKS"].Value.ToString();
             Showmaster1();*/
        }

      

    }
}
